<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for Psa_Group.class.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file Psa_Group.class.php</h1>
<p>Documentation is available at <a href="../psa/_scripts---Psa_Group.class.php.html">Psa_Group.class.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;User&nbsp;group&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;LICENSE:</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;library&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;library&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;See&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;*&nbsp;along&nbsp;with&nbsp;This&nbsp;library.&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;</span><span class="src-doc-inlinetag">{@link&nbsp;http://www.gnu.org/licenses/}</span><span class="src-doc">&gt;.</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://code.google.com/p/phpstartapp/</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Bojan&nbsp;Mauser&nbsp;&lt;bmauser@gmail.com&gt;</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@copyright</span><span class="src-doc">&nbsp;Bojan&nbsp;Mauser&nbsp;2009</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;psa</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@version</span><span class="src-doc">&nbsp;$Id:&nbsp;Psa_Group.class.php&nbsp;464&nbsp;2009-03-24&nbsp;00:30:12Z&nbsp;bmauser&nbsp;$</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;*&nbsp;User&nbsp;group&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;*&nbsp;Here&nbsp;are&nbsp;some&nbsp;examples&nbsp;of&nbsp;using&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group}</span><span class="src-doc">&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;*&nbsp;&lt;b&gt;Examples&lt;/b&gt;</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-doc">&nbsp;*&nbsp;&lt;b&gt;1)&lt;/b&gt;&nbsp;Create&nbsp;new&nbsp;user&nbsp;group:</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;create&nbsp;new&nbsp;user&nbsp;group&nbsp;use&nbsp;'new'&nbsp;as&nbsp;argument&nbsp;to&nbsp;constructor</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-doc">&nbsp;*&nbsp;$group&nbsp;=&nbsp;new&nbsp;Psa_Group('new');</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;set&nbsp;the&nbsp;name&nbsp;for&nbsp;new&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;*&nbsp;$group-&gt;name&nbsp;=&nbsp;'my_new_user_group';</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;you&nbsp;can&nbsp;set&nbsp;some&nbsp;custom&nbsp;properties&nbsp;of&nbsp;the&nbsp;new&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;and&nbsp;they&nbsp;will&nbsp;be&nbsp;saved&nbsp;with&nbsp;the&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;*&nbsp;$group-&gt;is_important_group&nbsp;=&nbsp;true;</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-doc">&nbsp;*&nbsp;$group-&gt;users_like&nbsp;=&nbsp;array('pizza','fish');</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;save&nbsp;group&nbsp;to&nbsp;database&nbsp;and&nbsp;get&nbsp;ID&nbsp;of&nbsp;newly&nbsp;created&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-doc">&nbsp;*&nbsp;$new_group_id&nbsp;=&nbsp;$group-&gt;save();</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-doc">&nbsp;*&nbsp;&lt;b&gt;2)&lt;/b&gt;&nbsp;Manage&nbsp;group&nbsp;tags:</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a53"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;work&nbsp;with&nbsp;user&nbsp;group&nbsp;named&nbsp;'my_user_group'</span></div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-doc">&nbsp;*&nbsp;$group&nbsp;=&nbsp;new&nbsp;Psa_Group('my_user_group');</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;add&nbsp;tag&nbsp;'soap_controller',&nbsp;'checkout'&nbsp;and&nbsp;'download'&nbsp;to&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;so&nbsp;all&nbsp;users&nbsp;in&nbsp;this&nbsp;group&nbsp;will&nbsp;have&nbsp;those&nbsp;tags</span></div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-doc">&nbsp;*&nbsp;$group-&gt;add_tag('soap_controller');</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;*&nbsp;$group-&gt;add_tag(array('checkout','download'));</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;remove&nbsp;tag&nbsp;'admin'</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;*&nbsp;$group-&gt;remove_tag('admin');</span></div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;you&nbsp;have&nbsp;to&nbsp;save&nbsp;group&nbsp;to&nbsp;store&nbsp;tags&nbsp;to&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-doc">&nbsp;*&nbsp;$group-&gt;save();</span></div></li>
<li><div class="src-line"><a name="a66"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a67"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a68"></a><span class="src-doc">&nbsp;*&nbsp;&lt;b&gt;Note:&lt;/b&gt;&nbsp;Read&nbsp;more&nbsp;about&nbsp;the&nbsp;tags&nbsp;</span><span class="src-doc-inlinetag">{@tutorial&nbsp;psa_features.pkg#usersgroups.tags&nbsp;here}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a69"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a70"></a><span class="src-key">class&nbsp;</span><a href="../psa/Psa_Group.html">Psa_Group</a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a73"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Group&nbsp;ID.</span></div></li>
<li><div class="src-line"><a name="a74"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Primary&nbsp;key&nbsp;from&nbsp;&lt;i&gt;psa_group&lt;/i&gt;&nbsp;database&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a75"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a76"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Note:&lt;/b&gt;&nbsp;You&nbsp;have&nbsp;read&nbsp;access&nbsp;to&nbsp;this&nbsp;property.</span></div></li>
<li><div class="src-line"><a name="a77"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../psa/Psa_Group.html#var$id">$id</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a84"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Name&nbsp;of&nbsp;the&nbsp;group.</span></div></li>
<li><div class="src-line"><a name="a85"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;There&nbsp;cannot&nbsp;be&nbsp;two&nbsp;groups&nbsp;with&nbsp;the&nbsp;same&nbsp;name.</span></div></li>
<li><div class="src-line"><a name="a86"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;will&nbsp;need&nbsp;to&nbsp;set&nbsp;this&nbsp;property&nbsp;when&nbsp;creating&nbsp;a&nbsp;new&nbsp;group&nbsp;or&nbsp;renaming&nbsp;group.</span></div></li>
<li><div class="src-line"><a name="a87"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a88"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
<li><div class="src-line"><a name="a89"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../psa/Psa_Group.html#var$name">$name</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a94"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Array&nbsp;with&nbsp;group&nbsp;tags.</span></div></li>
<li><div class="src-line"><a name="a95"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Indexes&nbsp;of&nbsp;this&nbsp;array&nbsp;are&nbsp;tag&nbsp;names.&nbsp;This&nbsp;array&nbsp;contains&nbsp;only&nbsp;tags&nbsp;that&nbsp;are&nbsp;assigned&nbsp;to&nbsp;this&nbsp;group.</span></div></li>
<li><div class="src-line"><a name="a96"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Manage&nbsp;this&nbsp;array&nbsp;with&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;add_tag()}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;remove_tag()}</span><span class="src-doc">&nbsp;methods.</span></div></li>
<li><div class="src-line"><a name="a97"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Read&nbsp;more&nbsp;about&nbsp;tags&nbsp;</span><span class="src-doc-inlinetag">{@tutorial&nbsp;psa_features.pkg#usersgroups.tags&nbsp;here}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a98"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a99"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Example:&lt;pre&gt;</span></div></li>
<li><div class="src-line"><a name="a100"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Array</span></div></li>
<li><div class="src-line"><a name="a101"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;(</span></div></li>
<li><div class="src-line"><a name="a102"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;['soap_controller']&nbsp;=&gt;&nbsp;1&nbsp;&nbsp;//&nbsp;index&nbsp;is&nbsp;tag&nbsp;id&nbsp;(name).&nbsp;All&nbsp;elements&nbsp;have&nbsp;value&nbsp;1.</span></div></li>
<li><div class="src-line"><a name="a103"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;['download_image']&nbsp;=&gt;&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a104"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;['admin_operations']&nbsp;=&gt;&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;)</span></div></li>
<li><div class="src-line"><a name="a106"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/pre&gt;</span></div></li>
<li><div class="src-line"><a name="a107"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a108"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Note:&lt;/b&gt;&nbsp;You&nbsp;have&nbsp;read&nbsp;access&nbsp;to&nbsp;this&nbsp;property.</span></div></li>
<li><div class="src-line"><a name="a109"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a110"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a111"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;add_tag()</span></div></li>
<li><div class="src-line"><a name="a112"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;remove_tag()</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;</span><span class="src-doc-internal">{@internal&nbsp;@see&nbsp;add_remove_tag()&nbsp;&nbsp;}}</span></div></li>
<li><div class="src-line"><a name="a114"></a><span class="src-doc-internal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../psa/Psa_Group.html#var$tags">$tags</a>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc-internal">/**</span></div></li>
<li><div class="src-line"><a name="a119"></a><span class="src-doc-internal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Database&nbsp;connect&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-doc-internal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a121"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">Psa_Pdo&nbsp;</span></div></li>
<li><div class="src-line"><a name="a122"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a123"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-var">$psa_database</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a125"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a126"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a127"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a128"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Flag&nbsp;if&nbsp;new&nbsp;group&nbsp;creation&nbsp;process&nbsp;is&nbsp;started.</span></div></li>
<li><div class="src-line"><a name="a129"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;is&nbsp;set&nbsp;from&nbsp;constructor.</span></div></li>
<li><div class="src-line"><a name="a130"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a131"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span></div></li>
<li><div class="src-line"><a name="a132"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a133"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-var">$new_group&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a137"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Flag&nbsp;if&nbsp;the&nbsp;group&nbsp;exists&nbsp;in&nbsp;the&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a139"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;value&nbsp;is&nbsp;set&nbsp;after&nbsp;group&nbsp;object&nbsp;is&nbsp;instanced&nbsp;or&nbsp;after&nbsp;saving&nbsp;a&nbsp;newly&nbsp;created&nbsp;group.</span></div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;can&nbsp;use&nbsp;it&nbsp;to&nbsp;check&nbsp;if&nbsp;the&nbsp;group&nbsp;exists&nbsp;in&nbsp;the&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a142"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Note:&lt;/b&gt;&nbsp;You&nbsp;have&nbsp;read&nbsp;access&nbsp;to&nbsp;this&nbsp;property.</span></div></li>
<li><div class="src-line"><a name="a143"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a144"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">1-true,&nbsp;0-false</span></div></li>
<li><div class="src-line"><a name="a145"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../psa/Psa_Group.html#var$exists">$exists</a>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a150"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Array&nbsp;that&nbsp;holds&nbsp;valuse&nbsp;of&nbsp;properties&nbsp;from&nbsp;custom&nbsp;columns&nbsp;added&nbsp;to&nbsp;psa_group&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a151"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a152"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a153"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a154"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a155"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-var">$orm_data&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a156"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a158"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a159"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Array&nbsp;that&nbsp;holds&nbsp;references&nbsp;to&nbsp;values&nbsp;that&nbsp;are&nbsp;changed&nbsp;in&nbsp;$orm_data&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a160"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;used&nbsp;to&nbsp;decide&nbsp;which&nbsp;orm&nbsp;properties&nbsp;to&nbsp;update&nbsp;in&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a161"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a162"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a163"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a164"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-var">$orm_data_changed&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a170"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Constructor.</span></div></li>
<li><div class="src-line"><a name="a171"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a172"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Must&nbsp;be&nbsp;called&nbsp;with&nbsp;group&nbsp;id&nbsp;(integer&nbsp;value)&nbsp;or&nbsp;group&nbsp;name&nbsp;(string&nbsp;value)&nbsp;as&nbsp;argument.</span></div></li>
<li><div class="src-line"><a name="a173"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Pass&nbsp;&lt;kbd&gt;'new'&lt;/kbd&gt;&nbsp;(string)&nbsp;argument&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;create&nbsp;a&nbsp;new&nbsp;group.</span></div></li>
<li><div class="src-line"><a name="a174"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;call&nbsp;constructor&nbsp;with&nbsp;group&nbsp;id&nbsp;(integer&nbsp;value)&nbsp;be&nbsp;sure&nbsp;to&nbsp;pass&nbsp;integer</span></div></li>
<li><div class="src-line"><a name="a175"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;as&nbsp;argument&nbsp;and&nbsp;use&nbsp;cast&nbsp;operator&nbsp;&lt;kbd&gt;(int)&lt;/kbd&gt;.</span></div></li>
<li><div class="src-line"><a name="a176"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;See&nbsp;examples&nbsp;in&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group}</span><span class="src-doc">&nbsp;class&nbsp;description.</span></div></li>
<li><div class="src-line"><a name="a177"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a178"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">string</span><span class="src-doc-var">$group&nbsp;</span><span class="src-doc">group&nbsp;id&nbsp;or&nbsp;'new'&nbsp;if&nbsp;new&nbsp;group&nbsp;should&nbsp;be&nbsp;created</span></div></li>
<li><div class="src-line"><a name="a179"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../psa/Psa_Group.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$group</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;database&nbsp;connect&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$psa_database</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a184"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;reference&nbsp;to&nbsp;global&nbsp;database&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a186"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_database&nbsp;</span>=&nbsp;<span class="src-var">$psa_database</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;new&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$group&nbsp;</span>===&nbsp;<span class="src-str">'new'</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;flag&nbsp;that&nbsp;new&nbsp;group&nbsp;creation&nbsp;process&nbsp;is&nbsp;started</span></div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">new_group&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;find&nbsp;if&nbsp;we&nbsp;have&nbsp;some&nbsp;orm&nbsp;data</span></div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">restore_new_group</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;existing&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$group&nbsp;</span>&amp;&amp;&nbsp;<a href="http://www.php.net/is_int">is_int</a><span class="src-sym">(</span><span class="src-var">$group</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a>&nbsp;=&nbsp;<span class="src-var">$group</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">restore</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;sets&nbsp;group&nbsp;properties&nbsp;(load&nbsp;previously&nbsp;saved&nbsp;data)</span></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a>&nbsp;=&nbsp;<span class="src-var">$group</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">restore</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;sets&nbsp;group&nbsp;properties&nbsp;(load&nbsp;previously&nbsp;saved&nbsp;data)</span></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a205"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a206"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a207"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a208"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Restores&nbsp;group&nbsp;properties&nbsp;from&nbsp;database&nbsp;previously&nbsp;saved&nbsp;with&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;save()}</span><span class="src-doc">&nbsp;method.</span></div></li>
<li><div class="src-line"><a name="a209"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;called&nbsp;from&nbsp;the&nbsp;constructor.</span></div></li>
<li><div class="src-line"><a name="a210"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a211"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;save()</span></div></li>
<li><div class="src-line"><a name="a212"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">1&nbsp;for&nbsp;success,&nbsp;0&nbsp;for&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a213"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@throws</span><span class="src-doc">&nbsp;Psa_Group_Exception</span></div></li>
<li><div class="src-line"><a name="a214"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a215"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a216"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">restore</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a217"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a218"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;id&nbsp;of&nbsp;the&nbsp;group&nbsp;is&nbsp;set</span></div></li>
<li><div class="src-line"><a name="a219"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a>&nbsp;<span class="src-key">or&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a220"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a221"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a222"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a223"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a224"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;load&nbsp;group&nbsp;data&nbsp;from&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a225"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_int">is_int</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a226"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">SELECT&nbsp;*&nbsp;FROM&nbsp;{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'group'</span><span class="src-sym">]</span><span class="src-sym">}</span>&nbsp;WHERE&nbsp;psa_id&nbsp;=&nbsp;'{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">}</span>'</span><span class="src-str"><span class="src-str">"</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a227"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a228"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;</span><span class="src-str"><span class="src-str">"</span>SELECT&nbsp;*&nbsp;FROM&nbsp;</span>{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'group'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;WHERE&nbsp;psa_name&nbsp;=&nbsp;'</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a><span class="src-sym">}</span>'</span><span class="src-str"><span class="src-str">"</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a229"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a230"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;query&nbsp;against&nbsp;the&nbsp;database</span></span></div></li>
<li><div class="src-line"><a name="a231"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">query</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a232"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a233"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;All&nbsp;data&nbsp;about&nbsp;the&nbsp;group.&nbsp;Entire&nbsp;row&nbsp;from&nbsp;database&nbsp;table</span></div></li>
<li><div class="src-line"><a name="a234"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$group_data&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">fetch_row</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a235"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a236"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;row&nbsp;in&nbsp;the&nbsp;database&nbsp;table&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a237"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$group_data</span><span class="src-sym">[</span><span class="src-str">'psa_id'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a238"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a239"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$group_data</span><span class="src-sym">[</span><span class="src-str">'psa_serialized_data'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a240"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a241"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;load&nbsp;all&nbsp;saved&nbsp;properties&nbsp;from&nbsp;saved&nbsp;object&nbsp;in&nbsp;the&nbsp;database</span></span></div></li>
<li><div class="src-line"><a name="a242"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$serialized_object</span>&nbsp;=&nbsp;<span class="src-id">unserialize</span><span class="src-sym">(</span><span class="src-id">base64_decode</span><span class="src-sym">(</span><span class="src-var">$group_data</span><span class="src-sym">[</span><span class="src-str">'psa_serialized_data'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a243"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a244"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">is_object</span><span class="src-sym">(</span><span class="src-var">$serialized_object</span><span class="src-sym">))</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a245"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;unset&nbsp;some&nbsp;properties&nbsp;to&nbsp;not&nbsp;override&nbsp;them&nbsp;in&nbsp;current&nbsp;group&nbsp;object</span></span></div></li>
<li><div class="src-line"><a name="a246"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">serialize_clean_obj</span><span class="src-sym">(</span><span class="src-var">$serialized_object</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a247"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a248"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;current&nbsp;objects&nbsp;properties</span></div></li>
<li><div class="src-line"><a name="a249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$serialized_object&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$serialized_object_key&nbsp;</span>=&gt;&nbsp;<span class="src-var">$serialized_object_value</span><span class="src-sym">)</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a250"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">$serialized_object_key&nbsp;</span>=&nbsp;<span class="src-var">$serialized_object_value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a252"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a253"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a254"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;if&nbsp;there&nbsp;are&nbsp;some&nbsp;custom&nbsp;table&nbsp;rows&nbsp;in&nbsp;pas_user&nbsp;database&nbsp;table</span></span></div></li>
<li><div class="src-line"><a name="a255"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">sizeof</span><span class="src-sym">(</span><span class="src-var">$group_data</span><span class="src-sym">)</span>&nbsp;>&nbsp;<span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a256"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">set_orm_data</span><span class="src-sym">(</span><span class="src-var">$group_data</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a258"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a259"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;objects&nbsp;properties&nbsp;from&nbsp;databse</span></span></div></li>
<li><div class="src-line"><a name="a260"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a>&nbsp;=&nbsp;(int)&nbsp;<span class="src-var">$group_data</span><span class="src-sym">[</span><span class="src-str">'psa_id'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a>&nbsp;=&nbsp;<span class="src-var">$group_data</span><span class="src-sym">[</span><span class="src-str">'psa_name'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;$exists&nbsp;flag&nbsp;that&nbsp;group&nbsp;exists&nbsp;in&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$exists">exists</a>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a265"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a268"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;group&nbsp;does&nbsp;not&nbsp;exists</span></span></div></li>
<li><div class="src-line"><a name="a269"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a270"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once</span>&nbsp;<span class="src-str">'Psa_Group_Exception.class.php'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a271"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new</span>&nbsp;<span class="src-id">Psa_Group_Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Group&nbsp;does&nbsp;not&nbsp;exists.&nbsp;Cannot&nbsp;restore&nbsp;data.&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-num">31</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a272"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a273"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a274"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a275"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a276"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once</span>&nbsp;<span class="src-str">'Psa_Group_Exception.class.php'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a277"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new</span>&nbsp;<span class="src-id">Psa_Group_Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Group&nbsp;id&nbsp;or&nbsp;group&nbsp;name&nbsp;are&nbsp;not&nbsp;set.&nbsp;Cannot&nbsp;load&nbsp;data&nbsp;about&nbsp;the&nbsp;group&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-num">32</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a278"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a279"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a280"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a281"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a282"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a283"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Checks&nbsp;if&nbsp;there&nbsp;are&nbsp;some&nbsp;custom&nbsp;table&nbsp;rows&nbsp;in&nbsp;pas_group&nbsp;database&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a284"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;finds&nbsp;out&nbsp;all&nbsp;columns&nbsp;from&nbsp;database&nbsp;and&nbsp;fills&nbsp;$orm_data&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a285"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a286"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore&nbsp;</span></div></li>
<li><div class="src-line"><a name="a287"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a288"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">restore_new_group</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a289"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a290"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global</span>&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a291"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a292"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;We&nbsp;need&nbsp;one&nbsp;dummy&nbsp;query&nbsp;here&nbsp;to&nbsp;get&nbsp;all&nbsp;column&nbsp;names.</span></span></div></li>
<li><div class="src-line"><a name="a293"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql_dummy</span>&nbsp;=&nbsp;<span class="src-str">"</span>SELECT&nbsp;*&nbsp;FROM&nbsp;</span>{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'group'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;LIMIT&nbsp;1<span class="src-str">"</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a294"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a295"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">query</span><span class="src-sym">(</span><span class="src-var">$sql_dummy</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a297"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;All&nbsp;data&nbsp;about&nbsp;the&nbsp;group.&nbsp;Entire&nbsp;row&nbsp;from&nbsp;database&nbsp;table</span></div></li>
<li><div class="src-line"><a name="a298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql_dummy_group_data&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">fetch_row</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">sizeof</span><span class="src-sym">(</span><span class="src-var">$sql_dummy_group_data</span><span class="src-sym">)&nbsp;</span>&gt;&nbsp;<span class="src-num">3</span><span class="src-sym">)</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a301"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">set_orm_data</span><span class="src-sym">(</span><span class="src-var">$sql_dummy_group_data</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a302"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a303"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a304"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a305"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a306"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a307"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Saves&nbsp;all&nbsp;properties&nbsp;of&nbsp;the&nbsp;group&nbsp;object&nbsp;to&nbsp;the&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a308"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;All&nbsp;saved&nbsp;properties&nbsp;will&nbsp;be&nbsp;restored&nbsp;{@internal&nbsp;with&nbsp;restore()&nbsp;method&nbsp;called&nbsp;from&nbsp;constructor}}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a309"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;when&nbsp;group&nbsp;object&nbsp;is&nbsp;created.</span></div></li>
<li><div class="src-line"><a name="a310"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;also&nbsp;sets&nbsp;{@link&nbsp;$id&nbsp;$id}&nbsp;member&nbsp;variable&nbsp;if&nbsp;a&nbsp;new&nbsp;group&nbsp;is&nbsp;created.</span></div></li>
<li><div class="src-line"><a name="a311"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;See&nbsp;examples&nbsp;in&nbsp;{@link&nbsp;Psa_Group}&nbsp;class&nbsp;description.&nbsp;This&nbsp;method&nbsp;will&nbsp;throw</span></div></li>
<li><div class="src-line"><a name="a312"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@link&nbsp;Psa_Group_Exception}&nbsp;on&nbsp;error.</span></div></li>
<li><div class="src-line"><a name="a313"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a314"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;int&nbsp;id&nbsp;of&nbsp;saved&nbsp;group&nbsp;for&nbsp;success</span></div></li>
<li><div class="src-line"><a name="a315"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;Psa_Group_Exception</span></div></li>
<li><div class="src-line"><a name="a316"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;__construct</span></div></li>
<li><div class="src-line"><a name="a317"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a318"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">save</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a319"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a320"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$exists">exists</a>&nbsp;<span class="src-key">or&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">new_group&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a><span class="src-sym">))</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a321"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a322"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></span></div></li>
<li><div class="src-line"><a name="a323"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global</span>&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a324"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a325"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;save&nbsp;only&nbsp;relevant&nbsp;data</span></span></div></li>
<li><div class="src-line"><a name="a326"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$temp_obj</span>&nbsp;=&nbsp;<span class="src-key">clone</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a327"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a328"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;unset&nbsp;unneeded&nbsp;data.&nbsp;Store&nbsp;only&nbsp;needed&nbsp;data&nbsp;in&nbsp;database.</span></span></div></li>
<li><div class="src-line"><a name="a329"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">serialize_clean_obj</span><span class="src-sym">(</span><span class="src-var">$temp_obj</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a330"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a331"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;serialize&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a332"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$serialized_data&nbsp;</span>=&nbsp;<span class="src-id">base64_encode</span><span class="src-sym">(</span><span class="src-id">serialize</span><span class="src-sym">(</span><span class="src-var">$temp_obj</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a333"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a334"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;this&nbsp;is&nbsp;new&nbsp;group&nbsp;creation</span></div></li>
<li><div class="src-line"><a name="a335"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">new_group</span><span class="src-sym">)</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a336"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;if&nbsp;there&nbsp;are&nbsp;some&nbsp;custom&nbsp;table&nbsp;rows&nbsp;in&nbsp;psa_group&nbsp;database&nbsp;table</span></span></div></li>
<li><div class="src-line"><a name="a337"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$custom_columns_insert</span>&nbsp;=&nbsp;<span class="src-id">psa_orm_make_query_parts</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data_changed</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a338"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;</span><span class="src-str"><span class="src-str">"</span>INSERT&nbsp;INTO&nbsp;</span>{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'group'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;(psa_serialized_data,psa_name<span class="src-str">"</span>&nbsp;.<span class="src-var">$custom_columns_insert</span><span class="src-sym">[</span><span class="src-str">'insert_query_columns'</span><span class="src-sym">]</span>.&nbsp;<span class="src-str">&quot;)&nbsp;VALUES&nbsp;(?,&nbsp;?&quot;</span>&nbsp;.&nbsp;<span class="src-var">$custom_columns_insert</span><span class="src-sym">[</span><span class="src-str">'insert_query_values'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">')'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a339"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$query_params</span>&nbsp;=&nbsp;<span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$serialized_data</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$custom_columns_insert</span><span class="src-sym">[</span><span class="src-str">'values'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a340"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a341"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;update&nbsp;existing&nbsp;group&nbsp;in&nbsp;the&nbsp;database</span></span></div></li>
<li><div class="src-line"><a name="a342"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a343"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;if&nbsp;there&nbsp;are&nbsp;some&nbsp;custom&nbsp;table&nbsp;rows&nbsp;in&nbsp;psa_group&nbsp;database&nbsp;table</span></span></div></li>
<li><div class="src-line"><a name="a344"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$custom_columns_update</span>&nbsp;=&nbsp;<span class="src-id">psa_orm_make_query_parts</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data_changed</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a345"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;</span><span class="src-str"><span class="src-str">"</span>UPDATE&nbsp;</span>{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'group'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;SET&nbsp;psa_serialized_data&nbsp;=&nbsp;?,&nbsp;psa_name=&nbsp;?<span class="src-str">"</span>&nbsp;.&nbsp;<span class="src-var">$custom_columns_update</span><span class="src-sym">[</span><span class="src-str">'update_query_set'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">&quot;&nbsp;WHERE&nbsp;psa_id&nbsp;=&nbsp;?&quot;</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a346"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$query_params</span>&nbsp;=&nbsp;<span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$serialized_data</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$custom_columns_update</span><span class="src-sym">[</span><span class="src-str">'values'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a347"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$query_params</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a348"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a349"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a350"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;Psa_Plugin_Before_group_Create&nbsp;plugins</span></span></div></li>
<li><div class="src-line"><a name="a351"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">new_group</span><span class="src-sym">)</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a352"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">psa_run_plugins</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'Psa_Plugin_Before_group_Create'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'psa_main'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)))</span><span class="src-sym">,</span><span class="src-str">'by_type'</span><span class="src-sym">,</span><span class="src-str">'no_unregistered_warning'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a353"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a354"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a355"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a356"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;query&nbsp;against&nbsp;the&nbsp;database</span></span></div></li>
<li><div class="src-line"><a name="a357"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">execute</span><span class="src-sym">(</span><span class="src-var">$query_params</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">prepare</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a358"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a359"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;the&nbsp;id&nbsp;value&nbsp;of&nbsp;object&nbsp;if&nbsp;new&nbsp;group&nbsp;is&nbsp;created</span></div></li>
<li><div class="src-line"><a name="a360"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">new_group</span><span class="src-sym">)</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a361"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a362"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;the&nbsp;id&nbsp;of&nbsp;new&nbsp;group</span></span></div></li>
<li><div class="src-line"><a name="a363"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a>&nbsp;=&nbsp;(int)&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">last_insert_id</span><span class="src-sym">(</span><span class="src-str">'psa_group_id_seq'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a364"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a365"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;turn&nbsp;off&nbsp;new_group&nbsp;flag</span></div></li>
<li><div class="src-line"><a name="a366"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">new_group&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a367"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a368"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;$exists&nbsp;flag&nbsp;that&nbsp;group&nbsp;exists&nbsp;in&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a369"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$exists">exists</a>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a370"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a371"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;Psa_Plugin_After_Group_Create&nbsp;plugins</span></div></li>
<li><div class="src-line"><a name="a372"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">psa_run_plugins</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'Psa_Plugin_After_Group_Create'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'psa_main'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)))</span><span class="src-sym">,</span><span class="src-str">'by_type'</span><span class="src-sym">,</span><span class="src-str">'no_unregistered_warning'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a373"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a374"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;restore&nbsp;all&nbsp;settings&nbsp;to&nbsp;get&nbsp;default&nbsp;orm&nbsp;data</span></div></li>
<li><div class="src-line"><a name="a375"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">count</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a376"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">restore</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a377"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a378"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;for&nbsp;log</span></div></li>
<li><div class="src-line"><a name="a379"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_message&nbsp;</span>=&nbsp;<span class="src-str">&quot;New&nbsp;group&nbsp;created&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a380"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span><span class="src-key">else</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a381"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;for&nbsp;log</span></span></div></li>
<li><div class="src-line"><a name="a382"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_message</span>&nbsp;=&nbsp;<span class="src-str">&quot;Group&nbsp;data&nbsp;saved&quot;</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a383"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a384"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a385"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;all&nbsp;orm&nbsp;properties&nbsp;are&nbsp;saved&nbsp;now&nbsp;so&nbsp;reset&nbsp;changes&nbsp;tracker</span></span></div></li>
<li><div class="src-line"><a name="a386"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data_changed&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a387"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a388"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;write&nbsp;log</span></div></li>
<li><div class="src-line"><a name="a389"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">log</span><span class="src-sym">(</span><span class="src-var">$log_message</span><span class="src-sym">,&nbsp;</span>__METHOD__<span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a390"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a391"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a392"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a393"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch&nbsp;<span class="src-sym">(</span><span class="src-id">Psa_Db_Exception</span>&nbsp;<span class="src-var">$e</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a394"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once</span>&nbsp;<span class="src-str">'Psa_Group_Exception.class.php'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a395"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new</span>&nbsp;<span class="src-id">Psa_Group_Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Error&nbsp;saving&nbsp;group&nbsp;data&nbsp;to&nbsp;database.&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-num">34</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a396"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a397"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a398"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a399"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once</span>&nbsp;<span class="src-str">'Psa_Group_Exception.class.php'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a400"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new</span>&nbsp;<span class="src-id">Psa_Group_Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Error&nbsp;saving&nbsp;group&nbsp;data&nbsp;to&nbsp;database.&nbsp;Group&nbsp;not&nbsp;exists&nbsp;or&nbsp;name&nbsp;not&nbsp;set&nbsp;for&nbsp;new&nbsp;group&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-num">35</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a401"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a402"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a403"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a404"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a405"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a406"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Fills&nbsp;$this-&gt;orm_data&nbsp;and&nbsp;sets&nbsp;values&nbsp;of&nbsp;object&nbsp;properties&nbsp;from&nbsp;orm&nbsp;database&nbsp;columns.</span></div></li>
<li><div class="src-line"><a name="a407"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a408"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;array&nbsp;$group_data&nbsp;'SELECT&nbsp;*'&nbsp;row&nbsp;from&nbsp;psa_group&nbsp;table</span></div></li>
<li><div class="src-line"><a name="a409"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;bool&nbsp;$set_nulls&nbsp;if&nbsp;true&nbsp;values&nbsp;in&nbsp;$this-&gt;orm_data&nbsp;will&nbsp;be&nbsp;filled&nbsp;with&nbsp;nulls.&nbsp;This&nbsp;is&nbsp;for&nbsp;</span></div></li>
<li><div class="src-line"><a name="a410"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;creation&nbsp;of&nbsp;new&nbsp;groups.</span></div></li>
<li><div class="src-line"><a name="a411"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore&nbsp;</span></div></li>
<li><div class="src-line"><a name="a412"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a413"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">set_orm_data</span><span class="src-sym">(</span><span class="src-sym">&</span><span class="src-var">$group_data</span><span class="src-sym">,</span><span class="src-var">$set_nulls</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a414"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a415"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$group_data</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$group_data_key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$group_data_value</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a416"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">substr</span><span class="src-sym">(</span><span class="src-var">$group_data_key</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-num">4</span><span class="src-sym">)</span>&nbsp;!=&nbsp;<span class="src-str">'psa_'</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a417"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a418"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$set_nulls</span><span class="src-sym">)</span></span></div></li>
<li><div class="src-line"><a name="a419"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$group_data_value</span>&nbsp;=&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a420"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a421"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">[</span><span class="src-var">$group_data_key</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$group_data_value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a422"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a423"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a424"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a425"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a426"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a427"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a428"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Adds&nbsp;group&nbsp;tags.</span></div></li>
<li><div class="src-line"><a name="a429"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;manage&nbsp;{@link&nbsp;$tags}&nbsp;member&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a430"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;need&nbsp;to&nbsp;call&nbsp;{@link&nbsp;save()}&nbsp;method&nbsp;after&nbsp;to&nbsp;store&nbsp;tags&nbsp;to&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a431"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;On&nbsp;error&nbsp;{@link&nbsp;Psa_Group_Exception}&nbsp;will&nbsp;be&nbsp;thrown.</span></div></li>
<li><div class="src-line"><a name="a432"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;See&nbsp;examples&nbsp;and&nbsp;note&nbsp;in&nbsp;{@link&nbsp;Psa_Group}&nbsp;class&nbsp;description.</span></div></li>
<li><div class="src-line"><a name="a433"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;This&nbsp;is&nbsp;wrapper&nbsp;method&nbsp;for&nbsp;add_remove_tag()&nbsp;method.}}</span></div></li>
<li><div class="src-line"><a name="a434"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a435"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string|array&nbsp;$tag&nbsp;name&nbsp;of&nbsp;the&nbsp;tag&nbsp;or&nbsp;array&nbsp;with&nbsp;tag&nbsp;names.</span></div></li>
<li><div class="src-line"><a name="a436"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;int&nbsp;0&nbsp;for&nbsp;failure,&nbsp;1&nbsp;for&nbsp;success</span></div></li>
<li><div class="src-line"><a name="a437"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;remove_tag()</span></div></li>
<li><div class="src-line"><a name="a438"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;@see&nbsp;add_remove_tag()&nbsp;&nbsp;}}</span></div></li>
<li><div class="src-line"><a name="a439"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a440"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">add_tag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a441"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a442"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">add_remove_tag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a443"></a>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a444"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a445"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a446"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a447"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Removes&nbsp;group&nbsp;tags.</span></div></li>
<li><div class="src-line"><a name="a448"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;manage&nbsp;{@link&nbsp;$tags}&nbsp;member&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a449"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;need&nbsp;to&nbsp;call&nbsp;{@link&nbsp;save()}&nbsp;method&nbsp;after&nbsp;to&nbsp;store&nbsp;tags&nbsp;to&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a450"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;On&nbsp;error&nbsp;{@link&nbsp;Psa_Group_Exception}&nbsp;will&nbsp;be&nbsp;thrown.</span></div></li>
<li><div class="src-line"><a name="a451"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;See&nbsp;examples&nbsp;and&nbsp;note&nbsp;in&nbsp;{@link&nbsp;Psa_Group}&nbsp;class&nbsp;description.</span></div></li>
<li><div class="src-line"><a name="a452"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;This&nbsp;is&nbsp;wrapper&nbsp;method&nbsp;for&nbsp;add_remove_tag()&nbsp;method.}}</span></div></li>
<li><div class="src-line"><a name="a453"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a454"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string|array&nbsp;$tag&nbsp;name&nbsp;of&nbsp;the&nbsp;tag&nbsp;or&nbsp;array&nbsp;with&nbsp;tag&nbsp;names.&nbsp;&lt;kbd&gt;'all'&lt;/kbd&gt;&nbsp;to&nbsp;remove&nbsp;all&nbsp;tags.</span></div></li>
<li><div class="src-line"><a name="a455"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;int&nbsp;0&nbsp;for&nbsp;failure,&nbsp;1&nbsp;for&nbsp;success</span></div></li>
<li><div class="src-line"><a name="a456"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;add_tag()</span></div></li>
<li><div class="src-line"><a name="a457"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;@see&nbsp;add_remove_tag()&nbsp;&nbsp;}}</span></div></li>
<li><div class="src-line"><a name="a458"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a459"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">remove_tag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a460"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a461"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">add_remove_tag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a462"></a>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a463"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a464"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a465"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a466"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Adds&nbsp;or&nbsp;removes&nbsp;group&nbsp;tags.</span></div></li>
<li><div class="src-line"><a name="a467"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;called&nbsp;from&nbsp;{@link&nbsp;remove_tag()}&nbsp;and&nbsp;{@link&nbsp;add_tag()}&nbsp;methods.</span></div></li>
<li><div class="src-line"><a name="a468"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;throws&nbsp;{@link&nbsp;Psa_Group_Exception}&nbsp;on&nbsp;error.</span></div></li>
<li><div class="src-line"><a name="a469"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a470"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string|array&nbsp;$tag&nbsp;id&nbsp;of&nbsp;the&nbsp;tag&nbsp;or&nbsp;array&nbsp;with&nbsp;tag&nbsp;ids.</span></div></li>
<li><div class="src-line"><a name="a471"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int&nbsp;$action&nbsp;1&nbsp;add,&nbsp;0&nbsp;remove</span></div></li>
<li><div class="src-line"><a name="a472"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;int&nbsp;0&nbsp;for&nbsp;failure,&nbsp;1&nbsp;for&nbsp;success</span></div></li>
<li><div class="src-line"><a name="a473"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;remove_tag()</span></div></li>
<li><div class="src-line"><a name="a474"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;add_tag()</span></div></li>
<li><div class="src-line"><a name="a475"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;Psa_Group_Exception</span></div></li>
<li><div class="src-line"><a name="a476"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore</span></div></li>
<li><div class="src-line"><a name="a477"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a478"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">add_remove_tag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$action</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a479"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a480"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a481"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a482"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></span></div></li>
<li><div class="src-line"><a name="a483"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global</span>&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a484"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a485"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;$tag&nbsp;is&nbsp;not&nbsp;array&nbsp;make&nbsp;it&nbsp;array&nbsp;for&nbsp;foreach&nbsp;loop</span></span></div></li>
<li><div class="src-line"><a name="a486"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">is_array</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">))</span></span></div></li>
<li><div class="src-line"><a name="a487"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tag</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a488"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a489"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;add&nbsp;or&nbsp;remove&nbsp;tag</span></span></div></li>
<li><div class="src-line"><a name="a490"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$tag</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$tag_key</span>&nbsp;=&gt;&nbsp;<span class="src-sym">&</span><span class="src-var">$tag_value</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a491"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a492"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;add&nbsp;tag.&nbsp;Add&nbsp;value&nbsp;1&nbsp;to&nbsp;$this-&gt;tags&nbsp;array&nbsp;for&nbsp;index&nbsp;$tag</span></span></div></li>
<li><div class="src-line"><a name="a493"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$action</span>&nbsp;==&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a494"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a495"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;add&nbsp;all&nbsp;tags</span></span></div></li>
<li><div class="src-line"><a name="a496"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag_value</span>&nbsp;==&nbsp;<span class="src-str">'all'</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a497"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tag_value</span>&nbsp;=&nbsp;<span class="src-str">'psa_all'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a498"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a499"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a500"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$tags">tags</a><span class="src-sym">[</span><span class="src-var">$tag_value</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a501"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a502"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a503"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;tag</span></span></div></li>
<li><div class="src-line"><a name="a504"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$action</span>&nbsp;==&nbsp;<span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a505"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a506"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;all&nbsp;tags</span></span></div></li>
<li><div class="src-line"><a name="a507"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag_value</span>&nbsp;==&nbsp;<span class="src-str">'all'</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a508"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$tags">tags</a>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a509"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a510"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a511"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;specific&nbsp;tag</span></span></div></li>
<li><div class="src-line"><a name="a512"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></span></div></li>
<li><div class="src-line"><a name="a513"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$tags">tags</a><span class="src-sym">[</span><span class="src-var">$tag_value</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a514"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a515"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a516"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a517"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;write&nbsp;log</span></span></div></li>
<li><div class="src-line"><a name="a518"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'logging'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'max_log_level'</span><span class="src-sym">]</span>&nbsp;&gt;=&nbsp;<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a519"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">log</span><span class="src-sym">(</span><span class="src-str">&quot;Group&nbsp;tag&nbsp;changed:&nbsp;&quot;&nbsp;</span>.&nbsp;<span class="src-id">implode</span><span class="src-sym">(</span><span class="src-str">','</span><span class="src-sym">,&nbsp;</span><span class="src-var">$tag</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">&quot;&nbsp;action=&quot;&nbsp;</span>.&nbsp;<span class="src-sym">(</span><span class="src-var">$action&nbsp;</span>?&nbsp;<span class="src-str">'add'&nbsp;</span>:&nbsp;<span class="src-str">'remove'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span>__METHOD__<span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a520"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a521"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a522"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a523"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a524"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a525"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once</span>&nbsp;<span class="src-str">'Psa_Group_Exception.class.php'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a526"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new</span>&nbsp;<span class="src-id">Psa_Group_Exception</span><span class="src-sym">(</span><span class="src-str">'Error&nbsp;changing&nbsp;group&nbsp;tags.&nbsp;Invalid&nbsp;$tag&nbsp;method&nbsp;parameter'</span><span class="src-sym">,</span>&nbsp;<span class="src-num">36</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a527"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a528"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a529"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a530"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a531"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Unsets&nbsp;some&nbsp;properties&nbsp;from&nbsp;group&nbsp;object&nbsp;that&nbsp;we&nbsp;do&nbsp;not&nbsp;want&nbsp;to&nbsp;save&nbsp;in&nbsp;the&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a532"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;helper&nbsp;function&nbsp;for&nbsp;{@link&nbsp;restore()}&nbsp;and&nbsp;save()&nbsp;functions.</span></div></li>
<li><div class="src-line"><a name="a533"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a534"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;object&nbsp;$group_object</span></div></li>
<li><div class="src-line"><a name="a535"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore</span></div></li>
<li><div class="src-line"><a name="a536"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a537"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">serialize_clean_obj</span><span class="src-sym">(</span><span class="src-var">$group_object</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a538"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a539"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">is_object</span><span class="src-sym">(</span><span class="src-var">$group_object</span><span class="src-sym">))</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a540"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$group_object</span></span><span class="src-sym">-&gt;</span><span class="src-id">orm_data</span><span class="src-sym">,&nbsp;</span><span class="src-var">$group_object</span><span class="src-sym">-&gt;</span><span class="src-id">orm_data_changed</span><span class="src-sym">,&nbsp;</span><span class="src-var">$group_object</span><span class="src-sym">-&gt;</span><span class="src-id">id</span><span class="src-sym">,&nbsp;</span><span class="src-var">$group_object</span><span class="src-sym">-&gt;</span><span class="src-id">name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$group_object</span><span class="src-sym">-&gt;</span><span class="src-id">psa_database</span><span class="src-sym">,&nbsp;</span><span class="src-var">$group_object</span><span class="src-sym">-&gt;</span><span class="src-id">new_group</span><span class="src-sym">,&nbsp;</span><span class="src-var">$group_object</span><span class="src-sym">-&gt;</span><span class="src-id">exists</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a541"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a542"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a543"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a544"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a545"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a546"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Puts&nbsp;user&nbsp;in&nbsp;the&nbsp;group&nbsp;or&nbsp;more&nbsp;users&nbsp;if&nbsp;the&nbsp;&lt;var&gt;$user_id&lt;/var&gt;&nbsp;argument&nbsp;is&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a547"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Group&nbsp;membership&nbsp;changes&nbsp;are&nbsp;immediately&nbsp;stored&nbsp;in&nbsp;the&nbsp;database&nbsp;and&nbsp;you&nbsp;don't&nbsp;have&nbsp;to&nbsp;</span></div></li>
<li><div class="src-line"><a name="a548"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;call&nbsp;{@link&nbsp;save()}&nbsp;method&nbsp;after.</span></div></li>
<li><div class="src-line"><a name="a549"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;creating&nbsp;a&nbsp;new&nbsp;group&nbsp;this&nbsp;method&nbsp;must&nbsp;be&nbsp;called&nbsp;after&nbsp;{@link&nbsp;save()}&nbsp;method.</span></div></li>
<li><div class="src-line"><a name="a550"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Throws&nbsp;{@link&nbsp;Psa_Group_Exception}&nbsp;on&nbsp;error.</span></div></li>
<li><div class="src-line"><a name="a551"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a552"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Example:</span></div></li>
<li><div class="src-line"><a name="a553"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a554"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;//&nbsp;group&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a555"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$group&nbsp;=&nbsp;new&nbsp;Psa_Group('my_user_group');</span></div></li>
<li><div class="src-line"><a name="a556"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;//&nbsp;put&nbsp;users&nbsp;with&nbsp;IDs&nbsp;1,3&nbsp;and&nbsp;6&nbsp;into&nbsp;the&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a557"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$group-&gt;add_user(array(1,3,6));</span></div></li>
<li><div class="src-line"><a name="a558"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a559"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a560"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;This&nbsp;is&nbsp;wrapper&nbsp;method&nbsp;for&nbsp;add_remove_user()&nbsp;method.}}</span></div></li>
<li><div class="src-line"><a name="a561"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int|array&nbsp;$user_id&nbsp;id&nbsp;of&nbsp;the&nbsp;user.&nbsp;Or&nbsp;array&nbsp;with&nbsp;user&nbsp;ids.</span></div></li>
<li><div class="src-line"><a name="a562"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;int&nbsp;1&nbsp;for&nbsp;success,&nbsp;-1&nbsp;user&nbsp;already&nbsp;was&nbsp;in&nbsp;the&nbsp;group&nbsp;(or&nbsp;more&nbsp;groups)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a563"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;or&nbsp;user&nbsp;does&nbsp;not&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a564"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;remove_user()</span></div></li>
<li><div class="src-line"><a name="a565"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;Psa_Group_Exception</span></div></li>
<li><div class="src-line"><a name="a566"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;@see&nbsp;add_remove_user()}}</span></div></li>
<li><div class="src-line"><a name="a567"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a568"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">add_user</span><span class="src-sym">(</span><span class="src-var">$user_id</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a569"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">add_remove_user</span><span class="src-sym">(</span><span class="src-var">$user_id</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a570"></a>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a571"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a572"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a573"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a574"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Removes&nbsp;user&nbsp;from&nbsp;the&nbsp;group&nbsp;or&nbsp;more&nbsp;users&nbsp;if&nbsp;the&nbsp;&lt;var&gt;$user_id&lt;/var&gt;&nbsp;argument&nbsp;is&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a575"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Group&nbsp;membership&nbsp;changes&nbsp;are&nbsp;immediately&nbsp;stored&nbsp;in&nbsp;the&nbsp;database&nbsp;and&nbsp;you&nbsp;don't&nbsp;have&nbsp;to&nbsp;</span></div></li>
<li><div class="src-line"><a name="a576"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;call&nbsp;{@link&nbsp;save()}&nbsp;method&nbsp;after.</span></div></li>
<li><div class="src-line"><a name="a577"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;creating&nbsp;a&nbsp;new&nbsp;group&nbsp;this&nbsp;method&nbsp;must&nbsp;be&nbsp;called&nbsp;after&nbsp;{@link&nbsp;save()}&nbsp;method.</span></div></li>
<li><div class="src-line"><a name="a578"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Throws&nbsp;{@link&nbsp;Psa_Group_Exception}&nbsp;on&nbsp;error.</span></div></li>
<li><div class="src-line"><a name="a579"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a580"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Example:</span></div></li>
<li><div class="src-line"><a name="a581"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a582"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;//&nbsp;group&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a583"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$group&nbsp;=&nbsp;new&nbsp;Psa_Group('my_user_group');</span></div></li>
<li><div class="src-line"><a name="a584"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;//&nbsp;remove&nbsp;user&nbsp;with&nbsp;ID&nbsp;6&nbsp;from&nbsp;the&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a585"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$group-&gt;remove_user(6);</span></div></li>
<li><div class="src-line"><a name="a586"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a587"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a588"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;This&nbsp;is&nbsp;wrapper&nbsp;method&nbsp;for&nbsp;add_remove_user()&nbsp;method.}}</span></div></li>
<li><div class="src-line"><a name="a589"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int|array&nbsp;$user_id&nbsp;id&nbsp;of&nbsp;the&nbsp;user.&nbsp;Or&nbsp;array&nbsp;with&nbsp;user&nbsp;ids.</span></div></li>
<li><div class="src-line"><a name="a590"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;int&nbsp;1&nbsp;for&nbsp;success,&nbsp;-1&nbsp;user&nbsp;already&nbsp;was&nbsp;in&nbsp;the&nbsp;group&nbsp;(or&nbsp;more&nbsp;groups)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a591"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;or&nbsp;user&nbsp;does&nbsp;not&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a592"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;remove_user()</span></div></li>
<li><div class="src-line"><a name="a593"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;Psa_Group_Exception</span></div></li>
<li><div class="src-line"><a name="a594"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;{@internal&nbsp;@see&nbsp;add_remove_user()}}</span></div></li>
<li><div class="src-line"><a name="a595"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a596"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">remove_user</span><span class="src-sym">(</span><span class="src-var">$user_id</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a597"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">add_remove_user</span><span class="src-sym">(</span><span class="src-var">$user_id</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a598"></a>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a599"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a600"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a601"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a602"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Puts&nbsp;user&nbsp;in&nbsp;the&nbsp;group&nbsp;or&nbsp;removes&nbsp;user&nbsp;from&nbsp;group&nbsp;(or&nbsp;more&nbsp;users&nbsp;if&nbsp;$user_id&nbsp;argument&nbsp;is&nbsp;array).</span></div></li>
<li><div class="src-line"><a name="a603"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;called&nbsp;from&nbsp;add_user()&nbsp;and&nbsp;remove_user()&nbsp;methods.</span></div></li>
<li><div class="src-line"><a name="a604"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a605"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int|array|string&nbsp;$user_id&nbsp;id&nbsp;of&nbsp;the&nbsp;user&nbsp;or&nbsp;array&nbsp;with&nbsp;user&nbsp;ids.</span></div></li>
<li><div class="src-line"><a name="a606"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int&nbsp;$action&nbsp;1&nbsp;add,&nbsp;0&nbsp;remove</span></div></li>
<li><div class="src-line"><a name="a607"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;int&nbsp;1&nbsp;for&nbsp;success,&nbsp;-1</span></div></li>
<li><div class="src-line"><a name="a608"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;add_user()</span></div></li>
<li><div class="src-line"><a name="a609"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;remove_user()</span></div></li>
<li><div class="src-line"><a name="a610"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;Psa_Group_Exception</span></div></li>
<li><div class="src-line"><a name="a611"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore&nbsp;</span></div></li>
<li><div class="src-line"><a name="a612"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a613"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">add_remove_user</span><span class="src-sym">(</span><span class="src-var">$user_id</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$action</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a614"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a615"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$exists">exists</a>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$user_id</span><span class="src-sym">)</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a616"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a617"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></span></div></li>
<li><div class="src-line"><a name="a618"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global</span>&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a619"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a620"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;$user_id&nbsp;is&nbsp;not&nbsp;array&nbsp;make&nbsp;it&nbsp;array&nbsp;for&nbsp;foreach&nbsp;loop</span></span></div></li>
<li><div class="src-line"><a name="a621"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">is_array</span><span class="src-sym">(</span><span class="src-var">$user_id</span><span class="src-sym">))</span></span></div></li>
<li><div class="src-line"><a name="a622"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user_id</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$user_id</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a623"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a624"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;flag&nbsp;if&nbsp;some&nbsp;query&nbsp;failed&nbsp;in&nbsp;the&nbsp;foreach&nbsp;loop</span></span></div></li>
<li><div class="src-line"><a name="a625"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$success</span>&nbsp;=&nbsp;<span class="src-var">$failed</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a626"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a627"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;add&nbsp;one&nbsp;or&nbsp;more&nbsp;users&nbsp;to&nbsp;group&nbsp;or&nbsp;remove&nbsp;from&nbsp;group</span></span></div></li>
<li><div class="src-line"><a name="a628"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$user_id</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$user_id_key</span>&nbsp;=&gt;&nbsp;<span class="src-sym">&</span><span class="src-var">$user_id_value</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a629"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a630"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;add&nbsp;to&nbsp;group</span></span></div></li>
<li><div class="src-line"><a name="a631"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$action</span>&nbsp;==&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a632"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql</span>&nbsp;=&nbsp;<span class="src-str">"</span>INSERT&nbsp;INTO&nbsp;</span>{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'user_in_group'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;(group_id,&nbsp;user_id)&nbsp;VALUES&nbsp;('</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">}</span>',&nbsp;'{<span class="src-var">$user_id_value</span><span class="src-str"></span><span class="src-sym">}</span>')<span class="src-str">"</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a633"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a634"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;from&nbsp;group</span></span></div></li>
<li><div class="src-line"><a name="a635"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$action</span>&nbsp;==&nbsp;<span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a636"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a637"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;all&nbsp;users&nbsp;from&nbsp;group</span></span></div></li>
<li><div class="src-line"><a name="a638"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$user_id_value</span>&nbsp;==&nbsp;<span class="src-str">'all'</span><span class="src-sym">)</span></span></div></li>
<li><div class="src-line"><a name="a639"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql</span>&nbsp;=&nbsp;<span class="src-str">"</span>DELETE&nbsp;FROM&nbsp;</span>{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'user_in_group'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;WHERE&nbsp;group_id&nbsp;=&nbsp;'</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">}</span>'</span><span class="src-str"><span class="src-str">"</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a640"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;specific&nbsp;user&nbsp;from&nbsp;group</span></span></div></li>
<li><div class="src-line"><a name="a641"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></span></div></li>
<li><div class="src-line"><a name="a642"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql</span>&nbsp;=&nbsp;<span class="src-str">"</span>DELETE&nbsp;FROM&nbsp;</span>{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'user_in_group'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;WHERE&nbsp;group_id&nbsp;=&nbsp;'</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">}</span>'&nbsp;AND&nbsp;user_id='{<span class="src-var">$user_id_value</span><span class="src-str"></span><span class="src-sym">}</span>'<span class="src-str">"</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a643"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a644"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a645"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;query&nbsp;against&nbsp;the&nbsp;database</span></span></div></li>
<li><div class="src-line"><a name="a646"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a647"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">query</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a648"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a649"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch<span class="src-sym">(</span><span class="src-id">Psa_Db_Exception</span>&nbsp;<span class="src-var">$e</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a650"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$failed</span>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a651"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a652"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a653"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;no&nbsp;rows&nbsp;affected&nbsp;user&nbsp;already&nbsp;wasn't&nbsp;or&nbsp;was&nbsp;in&nbsp;the&nbsp;group&nbsp;depending&nbsp;on&nbsp;$action</span></span></div></li>
<li><div class="src-line"><a name="a654"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">affected_rows</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>&lt;=&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a655"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$failed&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a656"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a657"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$success</span>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a658"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a659"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a660"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a661"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$success</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a662"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a663"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;write&nbsp;log</span></span></div></li>
<li><div class="src-line"><a name="a664"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'logging'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'max_log_level'</span><span class="src-sym">]</span>&nbsp;&gt;=&nbsp;<span class="src-num">2</span><span class="src-sym">)</span></span></div></li>
<li><div class="src-line"><a name="a665"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">log</span><span class="src-sym">(</span><span class="src-str">&quot;Members&nbsp;of&nbsp;group&nbsp;changed:&nbsp;&quot;&nbsp;</span>.&nbsp;<span class="src-id">implode</span><span class="src-sym">(</span><span class="src-str">','</span><span class="src-sym">,&nbsp;</span><span class="src-var">$user_id</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">&quot;&nbsp;action=&quot;&nbsp;</span>.&nbsp;<span class="src-sym">(</span><span class="src-var">$action&nbsp;</span>?&nbsp;<span class="src-str">'add'&nbsp;</span>:&nbsp;<span class="src-str">'remove'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span>__METHOD__<span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a666"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a667"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$failed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a668"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a669"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a670"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a671"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a672"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a673"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a674"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once</span>&nbsp;<span class="src-str">'Psa_Group_Exception.class.php'</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a675"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new</span>&nbsp;<span class="src-id">Psa_Group_Exception</span><span class="src-sym">(</span><span class="src-str">'Error&nbsp;changing&nbsp;members&nbsp;of&nbsp;group.&nbsp;Group&nbsp;not&nbsp;exists&nbsp;or&nbsp;invalid&nbsp;$user_id&nbsp;method&nbsp;parameter.'</span><span class="src-sym">,</span>&nbsp;<span class="src-num">22</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a676"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a677"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a678"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a679"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a680"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Handles&nbsp;logging&nbsp;for&nbsp;this&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a681"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;calls&nbsp;log()&nbsp;method&nbsp;of&nbsp;Psa_Logger&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a682"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a683"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$message&nbsp;log&nbsp;message</span></div></li>
<li><div class="src-line"><a name="a684"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$method&nbsp;class&nbsp;method&nbsp;which&nbsp;writes&nbsp;log&nbsp;message</span></div></li>
<li><div class="src-line"><a name="a685"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int&nbsp;$level&nbsp;log&nbsp;level</span></div></li>
<li><div class="src-line"><a name="a686"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$type&nbsp;'general',&nbsp;'error',&nbsp;'warning'&nbsp;...</span></div></li>
<li><div class="src-line"><a name="a687"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@see&nbsp;Psa_Logger::log()</span></div></li>
<li><div class="src-line"><a name="a688"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore</span></div></li>
<li><div class="src-line"><a name="a689"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a690"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">log</span><span class="src-sym">(</span><span class="src-var">$message</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$method</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$level</span>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$type</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a691"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a692"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></span></div></li>
<li><div class="src-line"><a name="a693"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global</span>&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a694"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a695"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;logging&nbsp;is&nbsp;enabled</span></span></div></li>
<li><div class="src-line"><a name="a696"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'logging'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'max_log_level'</span><span class="src-sym">]</span>&nbsp;&gt;=&nbsp;<span class="src-var">$level</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a697"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a698"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parameters&nbsp;for&nbsp;Psa_Logger::log()&nbsp;method</span></span></div></li>
<li><div class="src-line"><a name="a699"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'group_id'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$id">id</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a700"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'groupname'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#var$name">name</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a701"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$message</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a702"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'function'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$method</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a703"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'level'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$level</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a704"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$type</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a705"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">Psa_Logger</span><span class="src-sym">::</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">log</span><span class="src-sym">(</span><span class="src-var">$log_data</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a706"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a707"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a708"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a709"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a710"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a711"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore</span></div></li>
<li><div class="src-line"><a name="a712"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a713"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">__set</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$value</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a714"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a715"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;if&nbsp;orm&nbsp;property&nbsp;should&nbsp;be&nbsp;set</span></span></div></li>
<li><div class="src-line"><a name="a716"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">))</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a717"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a718"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">orm_data_changed</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a719"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a720"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;some&nbsp;property&nbsp;is&nbsp;not&nbsp;set&nbsp;set&nbsp;it</span></span></div></li>
<li><div class="src-line"><a name="a721"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">$name</span><span class="src-sym">))</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a722"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">$name&nbsp;</span>=&nbsp;<span class="src-var">$value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a723"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a724"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;show&nbsp;error</span></span></div></li>
<li><div class="src-line"><a name="a725"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a726"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$trace</span>&nbsp;=&nbsp;<span class="src-id">debug_backtrace</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a727"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">trigger_error</span><span class="src-sym">(</span><span class="src-str">'Cannot&nbsp;set&nbsp;protected&nbsp;property:&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$name</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;in&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$trace</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;on&nbsp;line&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$trace</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'line'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-id">E_USER_ERROR</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a728"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a729"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a730"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a731"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a732"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a733"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a734"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore</span></div></li>
<li><div class="src-line"><a name="a735"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a736"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">__get</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a737"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a738"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;enable&nbsp;to&nbsp;get&nbsp;orm&nbsp;properties</span></span></div></li>
<li><div class="src-line"><a name="a739"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">))&nbsp;</span><span class="src-str"></span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a740"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a741"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a742"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a743"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Makes&nbsp;some&nbsp;properties&nbsp;read-only</span></span></div></li>
<li><div class="src-line"><a name="a744"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$name</span>&nbsp;==&nbsp;<span class="src-str">'tags'</span>&nbsp;<span class="src-key">or</span>&nbsp;<span class="src-var">$name</span>&nbsp;==&nbsp;<span class="src-str">'id'</span>&nbsp;<span class="src-key">or</span>&nbsp;<span class="src-var">$name</span>&nbsp;==&nbsp;<span class="src-str">'name'</span>&nbsp;<span class="src-key">or</span>&nbsp;<span class="src-var">$name</span>&nbsp;==&nbsp;<span class="src-str">'exists'</span><span class="src-sym">)</span><span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a745"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">$name</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a746"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a747"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a748"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$trace</span>&nbsp;=&nbsp;<span class="src-id">debug_backtrace</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a749"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">trigger_error</span><span class="src-sym">(</span><span class="src-str">'Undefined&nbsp;object&nbsp;property:&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$name</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;in&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$trace</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;on&nbsp;line&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$trace</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'line'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-id">E_USER_NOTICE</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a750"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></span></div></li>
<li><div class="src-line"><a name="a751"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a752"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a753"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a754"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
<li><div class="src-line"><a name="a755"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@ignore</span></div></li>
<li><div class="src-line"><a name="a756"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a757"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public</span>&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">__isset</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
<li><div class="src-line"><a name="a758"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a759"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">$name</span><span class="src-sym">)&nbsp;</span><span class="src-key">or&nbsp;</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">orm_data</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a760"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a761"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a762"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a763"></a>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str"><span class="src-sym">}</span></span></div></li>
<li><div class="src-line"><a name="a764"></a>&nbsp;</div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Thu, 21 Oct 2010 01:40:51 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</body>
</html>